<template>
  <div class="card">
    <div class="card-body">
      <h5 class="font-weight-bold mb-5">单位信息</h5>

      <div class="media mt-3 mb-3">
        <img class="mr-5" width="100" :src="orgImage" />
        <div class="media-body">
          <h5 class="mt-0">{{ orgData.orgName }}</h5>
          <div>地址：{{ orgData.addressDetail }}</div>
          <p>简介：{{ orgData.orgDescription }}</p>
          <button type="button" class="btn btn-sm btn-outline-primary" @click="orgVisible = true">
            修 改
          </button>
        </div>
      </div>
    </div>

    <company-modify :visible.sync="orgVisible"></company-modify>
  </div>
</template>
<script>
import CompanyModify from './CompanyModify'

export default {
  components: {
    CompanyModify,
  },
  props: {},
  data() {
    return {
      orgVisible: false,
    }
  },
  computed: {
    orgData() {
      return this.$store.getters.org
    },

    orgImage() {
      let images = this.orgData.orgImages
      if (images) {
        let arr = images.replace(/^\["(\S+)"\]$/, '$1').split('","')
        return arr.length ? arr[0] : ''
      } else {
        return ''
      }
    },
  },
  watch: {},
  created() {},
  mounted() {},
  methods: {},
}
</script>
<style scoped></style>
